package com.xymtop.sqlcater.core.sql.sqlexecute.select.entity;


import lombok.Data;

import java.util.HashMap;
import java.util.Map;

//条件对象
@Data
public class SqlWhere {

    //查询map
   private Map<SqlSelectField,SqlSelectField> whereMap = new HashMap<>();


   //返回连接的条件
    public String buildSql(){
        String str = "";

        if(!whereMap.isEmpty()){

            for(SqlSelectField sqlSelectField : whereMap.keySet()){

                str+=sqlSelectField.getRealAsName()+"="+whereMap.get(sqlSelectField).getRealAsName();
            }

        }
        return str;
    }


}
